var tableviews = new Vue({
	el: '#tableviews',
	data: {
		list:[]
	},
	watch: {
		
	},
	mounted: function() {
	this.getData()
	},
	methods: {
		getData:function(){
			var _this = this;
			db.transaction(function(tx) {
				tx.executeSql('CREATE TABLE IF NOT EXISTS info (id,jd,wd,formtype,fammerid,fammername,type,typename,level,levelname,scale,output,date,localurl,path,des)');
				tx.executeSql('SELECT * FROM info', [], function(tx, results) {
					var len = results.rows.length;
					_this.list = []
					for(var i=0;i<len;i++){
						var im = {}
						im.des = results.rows.item(i).des
						im.id = results.rows.item(i).id
						im.formtype = results.rows.item(i).formtype
						_this.list.push(im)
					}
				
				}, null);
			});
		},
		deleteById:function(id){
			 var btnArray = ['否', '是'];
			 var _this = this
			mui.confirm('删除后无法回退，是否确定删除？','提示',btnArray,function(e){
				 if (e.index == 1) {
                       		db.transaction(function (tx) {
   				 tx.executeSql('DELETE FROM info  WHERE id='+id);
			});
			_this.getData() 
                        
                   } 
			})
	
		},
		toSubmit:function(id,formtype){
			localStorage.localid = id
			mui.openWindow('localInfoForm.html')
		}
		
	},
});